<?php

class CategoryController extends Zend_Controller_Action
{
    /**
     * @var Application_Model_Categorys
     */
    protected $_categorys;

    public function init()
    {
        // Breadcrumbs configuration
        $uri = $this->_request->getPathInfo();
        $activeNav = $this->view->navigation()->findByUri($uri);
        if ($activeNav) { // Controllo per evitare "Strict standards: Creating default object from empty value"
            $activeNav->active = true;
        }
        
        $this->_categorys = new Application_Model_Categorys();
    }

    public function indexAction()
    {
        $rootCategories = $this->_categorys->getCategoriesByParentId(0);
        $this->view->rootCategory = $rootCategories;
        
        $catVenti = $this->_categorys->getCategoryById(20);
        $this->view->catVenti = $catVenti;
        $this->view->descrizioneVenti = $catVenti->descrizione;
        $this->view->identificante = $catVenti->catIdent;
    }


}

